unit uSBD_Crypto_CTR;
{
Copyright 2009 Sean B. Durkin

This file is part of SBD Crypto Library.
SBD Crypto Library is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

SBD Crypto Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the Lesser GNU General Public License
along with SBD Crypto Library.  If not, see <http://www.gnu.org/licenses/>.
}
interface
uses Classes, uSBD_Crypto_StreamCipher, uSBD_Crypto_BlockCipher;

type

TCTR = class( TInterfacedObject, IBlockChainingModel)
  protected
    function Chain_EncryptBlock(
      Key: TSymetricKey; InitializationVector: TMemoryStream;
      const Cipher: IBlockCipher; const Param: IInterface): TBlockChainLink;

    function Chain_DecryptBlock(
      Key: TSymetricKey; InitializationVector: TMemoryStream;
      const Cipher: IBlockCipher; const Param: IInterface): TBlockChainLink;

    function  DisplayName: string;
    function  ProgId: string;
    function  Features: TAlgorithmicFeatureSet;
  end;

TCTRLink = class( TBlockChainLink)
  public
    procedure Encrypt_Block( Plaintext{in}, Ciphertext{out}: TMemoryStream);  override;
    procedure Decrypt_Block( Plaintext{out}, Ciphertext{in}: TMemoryStream);  override;
  end;


implementation




{ TCTR }

function TCTR.Chain_DecryptBlock( Key: TSymetricKey;
  InitializationVector: TMemoryStream; const Cipher: IBlockCipher;
  const Param: IInterface): TBlockChainLink;
begin
// tbd
result := nil
end;



function TCTR.Chain_EncryptBlock( Key: TSymetricKey;
  InitializationVector: TMemoryStream; const Cipher: IBlockCipher;
  const Param: IInterface): TBlockChainLink;
begin
// tbd
result := nil
end;



function TCTR.DisplayName: string;
begin
// tbd
result := 'CTR'
end;



function TCTR.Features: TAlgorithmicFeatureSet;
begin
result := [afNotImplementedYet]
end;

function TCTR.ProgId: string;
begin
// tbd
result := 'native.CTR'
end;





{ TCTRLink }

procedure TCTRLink.Decrypt_Block( Plaintext, Ciphertext: TMemoryStream);
begin
// tbd
end;



procedure TCTRLink.Encrypt_Block( Plaintext, Ciphertext: TMemoryStream);
begin
// tbd
end;

end.

